// Copyright (c), 2006, adopus consulting GmbH Switzerland, all rights reserved.
package com.purej.ui;

/**
 * Listeners for {@link Task} notifications can implement this interface
 * and register themself at the {@link Application}.
 *
 * @author Stefan Mueller
 */
public interface TaskListener {

  /**
   * Will be called if a task has been started.
   *
   * @param task the task
   */
  void taskStarted(Task<?> task);

  /**
   * Will be called if a task has been finished.
   *
   * @param task the task
   * @param info message about task finishing (to be display in the status bar for example)
   */
  void taskFinished(Task<?> task, String info);

  /**
   * Will be called if a task delivers a message for the status bar.
   *
   * @param task the task
   * @param message the message
   */
  void taskStatusMessage(Task<?> task, String message);

  /**
   * Will be called if a task delivers an error message.
   *
   * @param task the task
   * @param message the error message
   */
  void taskErrorMessage(Task<?> task, String message);
}
